跳到主要内容

clash


cat > /usr/lib/systemd/system/clash.service << EOF
[Unit]
Description=clash client
After=network.target
Wants=network.target

[Service]
#一开始没加这两句话,frp自己老是起不来,后面需要深入理解systemctl原理
Restart=on-failure
RestartSec=5

WorkingDirectory=~
#启动服务的命令(此处写你的frps的实际安装目录 客户端or服务端)
ExecStart=/opt/soft/clash/clash -f /opt/soft/clash/config.yml

[Install]
WantedBy=multi-user.target
EOF

systemctl daemon-reload systemctl start cloudreve

journalctl -u 服务名

tail -f /var/log/messages

clash


# (HTTP and SOCKS5 in one port)
mixed-port: 7890
# Port of HTTP(S) proxy server on the local end
port: 1080
# Port of SOCKS5 proxy server on the local end
socks-port: 1086
# RESTful API for clash
external-controller: 127.0.0.1:9090
allow-lan: false
mode: rule
log-level: warning

proxies:
- { name: '666', type: vmess, server: cs2.ftnodes1.xyz, port: 443, uuid: 4581b465-935a-30b4-b283-6e1858ff226f, alterId: 0, cipher: auto, udp: true, network: ws, ws-path: /, ws-headers: { Host: shoutingtoutiao3.10010.com } }
- { name: '888', type: vmess, server: 8.130.52.106, port: 7890, uuid: b831381d-1324-4d53-ad4f-8cdaf8b30811, alterId: 64, cipher: auto, udp: false, network: ws, ws-path: /, ws-headers: { Host: shoutingtoutiao3.10010.com } }
- { name: '889', type: vmess, server: 8.130.52.106, port: 7891, uuid: b831381d-1324-4d53-ad4f-8cdaf8b30811, alterId: 64, cipher: auto, udp: false, network: ws, ws-path: /, ws-headers: { Host: shoutingtoutiao3.10010.com } }

proxy-groups:
- { name: Fartrans, type: select, proxies: [666,888,889] }


rules:
- DOMAIN-SUFFIX,google.com,DIRECT
- DOMAIN-KEYWORD,google,DIRECT
- DOMAIN,google.com,DIRECT
- DOMAIN-SUFFIX,ad.com,REJECT
- GEOIP,CN,Fartrans
- MATCH,Fartrans